package com.hr.service.impl;
import java.util.List;

import com.hr.dao.AdminDao;
import com.hr.dao.impl.AdminDaoImpl;
import com.hr.pojo.Admin;
import com.hr.service.AdminService;
public class AdminServiceImpl implements AdminService {
	private	AdminDao userDao = new AdminDaoImpl();
	@Override
	public Admin findUserByUsernameAndPassword(String username, String password) {
		Admin user = userDao.findUserByUsernameAndPassword(username,  password);
		return user;
	}
	@Override
	public void saveUser(Admin user) {
		AdminDao userDao = new AdminDaoImpl();
		userDao.saveUser(user);
	}
	@Override
	public List findAllUsers() {
		AdminDao userDao = new AdminDaoImpl();
		return userDao.findAllUsers();
	}
	@Override
	public Admin findUserById(String id) {
		AdminDao userDao = new AdminDaoImpl();
		Admin user=userDao.findUserById(id);
		return user;
	}
	@Override
	public void updateUser(Admin user) {
		AdminDao userDao = new AdminDaoImpl();
		userDao.updateUser(user);
	}
	@Override
	public void delete(String id) {
		AdminDao userDao = new AdminDaoImpl();
		userDao.delete(id);
	}
}
